

package com.hazelcast.client.impl.protocol.codec.builtin;

import com.hazelcast.client.impl.protocol.ClientMessage;

import java.util.List;

import static com.hazelcast.client.impl.protocol.codec.builtin.FixedSizeTypesCodec.LONG_SIZE_IN_BYTES;

public final class ListCNLongCodec {

    private ListCNLongCodec() {
    }

    public static void encode(ClientMessage clientMessage, Iterable<Long> items) {
        ListCNFixedSizeCodec.encode(clientMessage, items, LONG_SIZE_IN_BYTES, FixedSizeTypesCodec::encodeLong);
    }

    public static List<Long> decode(ClientMessage.ForwardFrameIterator iterator) {
        return decode(iterator.next());
    }

    public static List<Long> decode(ClientMessage.Frame frame) {
        return ListCNFixedSizeCodec.decode(frame, LONG_SIZE_IN_BYTES, FixedSizeTypesCodec::decodeLong);
    }
}
